﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LogicNP.ShellObjects;

namespace CheckingLine
{
    public partial class OptionsForm : Form
    {
        public OptionsForm()
        {
            InitializeComponent();
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            
        }

        private void checkBox1_Click(object sender, EventArgs e)
        {
            try
            {
                if (checkBox1.Checked)
                {
                    shellUtils1.AddToStartupRunList(StartupType.LocalMachineRun, Application.ExecutablePath);
                }
                else
                {
                    shellUtils1.RemoveFromStartupRunList(StartupType.LocalMachineRun, Application.ExecutablePath);
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("发生异常： \r\n" + ex.Message + "\r\n请确保你有管理员权限。" );
            }
        }
    }
}
